<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/admin/lib/layui/css/layui.css" media="all">
    <style>
        .layui-form-item {
            margin-top: 15px;
        }

        .layui-input {
            width: 80%;
        }
    </style>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div class="layui-col-md8 layui-col-xs12">
    <form class="layui-form" method="post" lay-filter="example">
        <div class="layui-form-item">
            <input type="hidden" name="id" id="id">
            <div class="layui-form-item">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block">
                    <input type="text" name="content" id="content" lay-verify="required" autocomplete="off"
                           placeholder="内容" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"> 状　态</label>
                <div class="layui-input-block newsStatus">
                    <select name="status" id="status" lay-verify="required">
                        <option value="0" selected>通知</option>
                        <option value="1">警告</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <a class="layui-btn" lay-submit="" lay-filter="addNews">立即提交</a>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
</html>
<script src="/admin/lib/layui/layui.js" charset="utf-8"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
    layui.use(['form', 'layer', 'layedit', 'laydate', 'upload'], function () {
        var form = layui.form
        layer = parent.layer === undefined ? layui.layer : top.layer,
            laypage = layui.laypage,
            laydate = layui.laydate,
            $ = layui.jquery;

        //格式化时间
        function filterTime(val) {
            if (val < 10) {
                return "0" + val;
            } else {
                return val;
            }
        }
    })
</script>

